window.globalCreateAudioPlayer = function () {
            var inited = false;
            var audio = null;
            return {
                inited: function () { return inited; },
                audio: function () { return audio; },
                init: function (o, autoplay) {
                    audio = o || new Audio();
                    try {
                        audio.initTouchstart = false;
                        audio.startPlayed = false;
                    } catch (e) { }
                    try {
                        audio.preload = "auto";
						
                        if (!!autoplay) {
                            audio.autoplay = true;

                        } else {
                            audio.autoplay = false;
                        }

                        audio.loop = true;
                        audio.muted = false;
                        audio.src = audio.currentSrc;
                    } catch (e) { }
                    try {
                        audio.isLoadedmetadata = false;
                        audio.touchstart = true;
                        audio.audio = true;
                    } catch (e) { }

                    audio.addEventListener('ended', function () { try { audio.play(); } catch (e) { } }, false);
                    audio.addEventListener('loadstart', function () {
                        try { audio.play(); } catch (e) { }
                        try { audio.pause(); } catch (e) { }
                    }, false);
                    audio.addEventListener('loadedmetadata', function () {
                        audio.isLoadedmetadata = true;
                    }, false);
                    audio.addEventListener('loadeddata', function () {
                        try { audio.pause(); } catch (e) { }
                        try { audio.play(); } catch (e) { }
                    }, false);

                    try { audio.load(); } catch (e) { }
                    try { audio.play(); } catch (e) { }

                    var initTouchstart = function () {
                        $(document).one('touchstart', function (e) {
                            audio.touchstart = true;
                            if (!audio.startPlayed && (audio.ended || audio.paused)) {
                                audio.play();
                                audio.pause();
                                audio.play();
                            }
                            audio.initTouchstart = false;
                            return false;
                        });
                        audio.initTouchstart = true;
                    };

                    (function () {
                        var audioStateInterval = setInterval(function () {
                            //alert("readyState:" + audio.readyState + " | played.length:" + audio.played.length + " | paused:" + audio.paused + " | ended:" + audio.ended + " | buffered.length:" + audio.buffered.length + " | autoplay:" + audio.autoplay + " | loop:" + audio.loop);
                            if (audio.autoplay && !audio.startPlayed) {
                                //需要Touch事件才能执行的 检查初实事件
                                if (!audio.initTouchstart && !audio.startPlayed && (audio.ended || audio.paused)) {
                                    initTouchstart();
                                }
                                //发现audio已准备好 则调用播放
								//alert(audio.readyState+" "+audio.buffered.length);
                                if (audio.readyState == 4 || (audio.readyState == 0 && audio.buffered > 0)) {
                                    if (audio.currentTime == 0) {
                                        try { audio.currentTime = 1 } catch (e) { }
                                    }
                                    if (audio.ended || audio.paused) {
                                        try { audio.play(); } catch (e) { }
                                    }
                                }
                                //已在播放 退出 监测
                                if (audio.currentTime > 1 && audio.played.length > 0 && (!audio.ended && !audio.paused)) {
                                    clearInterval(audioStateInterval);
                                    audio.startPlayed = true;
                                    inited = true;
                                }
                            }
                            else {
                                clearInterval(audioStateInterval);
                                audio.startPlayed = !audio.ended && !audio.paused;
                                inited = true;
                            }
                        }, 500);
                    })();
                },
                playOrPause: function () {
                    if (inited) {
                        if (audio) {
                            if (audio.ended || audio.paused) {
                                try { audio.play(); } catch (e) { }
                                return true;
                            }
                            else {
                                try { audio.pause(); } catch (e) { }
                                return false;
                            }
                        }
                        else {
                            return false;
                        }
                    }
                    else {
                        return audio && !audio.ended && !audio.paused;
                    }
                },
                play: function () {
                    if (inited) {
                        if (audio) {
                            try { audio.play(); } catch (e) { }
                        }
                    }
                },
                pause: function () {
                    if (inited) {
                        if (audio) {
                            try { audio.pause(); } catch (e) { }
                        }
                    }
                },
                played: function () { return audio && !audio.ended && !audio.paused; }
            }
        }